home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tas412.zip / BBAND.TAS < prev    next >
Text File  |  1991-11-26  |  2KB  |  56 lines

  1. { BBAND.TAS - This script computes BOLLINGER BANDS.
  2.   Bollinger bands are lines which are 'n' standard deviations away
  3.   from a 'p' day moving average of the close.
  4.   To change the value of 'n', change 'bband_devs' below. To
  5.   change the value of 'p', change 'bband_period' below.
  6.  
  7.   NOTE- This script will use the optional GRAPH feature of TAS. 
  8.   If it is not registered to run GRAPH's then it will terminate 
  9.   on the SECOND graph. 
  10.  
  11.   If you wish to continue viewing graphs, see the REGISTER.DOC 
  12.   file included with the TAS system. That file contains the 
  13.   pricing and ordering information for the GRAPH feature.
  14. }
  15. #output_file 'bband.lst' n
  16. #max_quotes 200
  17. GRAPH_SWITCH = 1; {<--------- SET THIS TO 1 TO SEE GRAPHS}
  18. bband_period = 20;              { number of days in BBAND period }
  19. bband_devs   = 2;               { number of STD DEVIATIONS about close}
  20. bband_top : array;              { top band }
  21. bband_bot : array;              { bottom band }
  22. {
  23.   Top Bollinger Band
  24. }
  25. bband_top = bbandt(20,2);
  26. {
  27.   Bottom Bollinger Band
  28. }
  29. bband_bot = bbandb(20,2);
  30. { Now, the rest is up to you. I have suppied a simple check to see
  31.   if the current close is over the top band or below the bottom band.
  32.   You can use these BBAND arrays to check for the narrowing of the
  33.   bands, tops or bottoms outside the bands, and bouncing off the
  34.   bands.
  35. }
  36. if over(c,bband_top) <= 0 then        
  37. begin
  38.   gosub dograph;
  39.   writeln(ticker,' BBAND upward breakout occurred');
  40. end;
  41. if over(bband_bot,c) <= 0 then
  42. begin
  43.   gosub dograph;
  44.   writeln(ticker,' BBAND downward breakout occurred');
  45. end;
  46. return;
  47. :dograph
  48. if graph_switch = 0 then return;
  49. opengraph(3,0,0);
  50. sizegraph(2,1,1);       { size the graphs 50%, 25%, 25%}
  51. graph(bband_top,bband_bot,1);
  52. graph(macd(),'Macd',macdtrigger(),'Trigger');
  53. graph(adx(14),'ADX 14',PDI(14),'PDI 14',MDI(14),'MDI 14');
  54. closegraph();
  55. return;
  56.